//
//  YZChatMessageTextCell.m
//  CocoaAsyncSocketClient
//
//  Created by lixiaoyi on 2018/6/25.
//  Copyright © 2018年 lixiaoyi. All rights reserved.
//

#import "YZChatMessageTextCell.h"

@implementation YZChatMessageTextCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.chatLabel];
    }
    
    return self;
}

#pragma mark - private method
- (void)setModelFrame:(YZMessageFrame *)modelFrame
{
    [super setModelFrame:modelFrame];
    self.chatLabel.frame = modelFrame.chatLabelF;
//    [self.chatLabel setAttributedText:[ICFaceManager transferMessageString:modelFrame.model.message.content font:self.chatLabel.font lineHeight:self.chatLabel.font.lineHeight]];
    NSString *content = [[NSString alloc] initWithData:modelFrame.model.message.playLoad encoding:NSUTF8StringEncoding];
        self.chatLabel.text = content;
}


#pragma mark - Getter and Setter
- (UILabel *)chatLabel {
    if (!_chatLabel) {
        _chatLabel = [UILabel new];
        _chatLabel.numberOfLines = 0;
        _chatLabel.font = MessageFont;
        _chatLabel.textColor = ICRGB(0x282724);
    }
    
    return _chatLabel;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
